/*
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
 * the License at http://www.openbravo.com/legal/license.html
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
 * All portions are Copyright (C) 2008-2014 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************
*/
package org.openbravo.model.common.currency;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.openbravo.base.structure.ActiveEnabled;
import org.openbravo.base.structure.BaseOBObject;
import org.openbravo.base.structure.ClientEnabled;
import org.openbravo.base.structure.OrganizationEnabled;
import org.openbravo.base.structure.Traceable;
import org.openbravo.model.ad.access.Role;
import org.openbravo.model.ad.access.User;
import org.openbravo.model.ad.system.Client;
import org.openbravo.model.common.enterprise.Organization;
import org.openbravo.model.common.geography.Country;
/**
 * Entity class for entity Currency (stored in table C_Currency).
 *
 * NOTE: This class should not be instantiated directly. To instantiate this
 * class the {@link org.openbravo.base.provider.OBProvider} should be used.
 */
public class Currency extends BaseOBObject implements Traceable, ClientEnabled, OrganizationEnabled, ActiveEnabled {
    private static final long serialVersionUID = 1L;
    public static final String TABLE_NAME = "C_Currency";
    public static final String ENTITY_NAME = "Currency";
    public static final String PROPERTY_ID = "id";
    public static final String PROPERTY_CLIENT = "client";
    public static final String PROPERTY_ORGANIZATION = "organization";
    public static final String PROPERTY_ACTIVE = "active";
    public static final String PROPERTY_CREATIONDATE = "creationDate";
    public static final String PROPERTY_CREATEDBY = "createdBy";
    public static final String PROPERTY_UPDATED = "updated";
    public static final String PROPERTY_UPDATEDBY = "updatedBy";
    public static final String PROPERTY_ISOCODE = "iSOCode";
    public static final String PROPERTY_SYMBOL = "symbol";
    public static final String PROPERTY_DESCRIPTION = "description";
    public static final String PROPERTY_STANDARDPRECISION = "standardPrecision";
    public static final String PROPERTY_COSTINGPRECISION = "costingPrecision";
    public static final String PROPERTY_PRICEPRECISION = "pricePrecision";
    public static final String PROPERTY_CURRENCYSYMBOLATTHERIGHT = "currencySymbolAtTheRight";
    public static final String PROPERTY_ADCLIENTLIST = "aDClientList";
    public static final String PROPERTY_ADROLELIST = "aDRoleList";
    public static final String PROPERTY_COUNTRYLIST = "countryList";
    public static final String PROPERTY_CURRENCYTRLLIST = "currencyTrlList";
    public static final String PROPERTY_ORGANIZATIONLIST = "organizationList";

    public Currency() {
        setDefaultValue(PROPERTY_ACTIVE, true);
        setDefaultValue(PROPERTY_STANDARDPRECISION, (long) 2);
        setDefaultValue(PROPERTY_COSTINGPRECISION, (long) 4);
        setDefaultValue(PROPERTY_PRICEPRECISION, (long) 0);
        setDefaultValue(PROPERTY_CURRENCYSYMBOLATTHERIGHT, false);
        setDefaultValue(PROPERTY_ADCLIENTLIST, new ArrayList<Object>());
        setDefaultValue(PROPERTY_ADROLELIST, new ArrayList<Object>());
        setDefaultValue(PROPERTY_COUNTRYLIST, new ArrayList<Object>());
        setDefaultValue(PROPERTY_CURRENCYTRLLIST, new ArrayList<Object>());
        setDefaultValue(PROPERTY_ORGANIZATIONLIST, new ArrayList<Object>());
    }

    @Override
    public String getEntityName() {
        return ENTITY_NAME;
    }

    public String getId() {
        return (String) get(PROPERTY_ID);
    }

    public void setId(String id) {
        set(PROPERTY_ID, id);
    }

    public Client getClient() {
        return (Client) get(PROPERTY_CLIENT);
    }

    public void setClient(Client client) {
        set(PROPERTY_CLIENT, client);
    }

    public Organization getOrganization() {
        return (Organization) get(PROPERTY_ORGANIZATION);
    }

    public void setOrganization(Organization organization) {
        set(PROPERTY_ORGANIZATION, organization);
    }

    public Boolean isActive() {
        return (Boolean) get(PROPERTY_ACTIVE);
    }

    public void setActive(Boolean active) {
        set(PROPERTY_ACTIVE, active);
    }

    public Date getCreationDate() {
        return (Date) get(PROPERTY_CREATIONDATE);
    }

    public void setCreationDate(Date creationDate) {
        set(PROPERTY_CREATIONDATE, creationDate);
    }

    public User getCreatedBy() {
        return (User) get(PROPERTY_CREATEDBY);
    }

    public void setCreatedBy(User createdBy) {
        set(PROPERTY_CREATEDBY, createdBy);
    }

    public Date getUpdated() {
        return (Date) get(PROPERTY_UPDATED);
    }

    public void setUpdated(Date updated) {
        set(PROPERTY_UPDATED, updated);
    }

    public User getUpdatedBy() {
        return (User) get(PROPERTY_UPDATEDBY);
    }

    public void setUpdatedBy(User updatedBy) {
        set(PROPERTY_UPDATEDBY, updatedBy);
    }

    public String getISOCode() {
        return (String) get(PROPERTY_ISOCODE);
    }

    public void setISOCode(String iSOCode) {
        set(PROPERTY_ISOCODE, iSOCode);
    }

    public String getSymbol() {
        return (String) get(PROPERTY_SYMBOL);
    }

    public void setSymbol(String symbol) {
        set(PROPERTY_SYMBOL, symbol);
    }

    public String getDescription() {
        return (String) get(PROPERTY_DESCRIPTION);
    }

    public void setDescription(String description) {
        set(PROPERTY_DESCRIPTION, description);
    }

    public Long getStandardPrecision() {
        return (Long) get(PROPERTY_STANDARDPRECISION);
    }

    public void setStandardPrecision(Long standardPrecision) {
        set(PROPERTY_STANDARDPRECISION, standardPrecision);
    }

    public Long getCostingPrecision() {
        return (Long) get(PROPERTY_COSTINGPRECISION);
    }

    public void setCostingPrecision(Long costingPrecision) {
        set(PROPERTY_COSTINGPRECISION, costingPrecision);
    }

    public Long getPricePrecision() {
        return (Long) get(PROPERTY_PRICEPRECISION);
    }

    public void setPricePrecision(Long pricePrecision) {
        set(PROPERTY_PRICEPRECISION, pricePrecision);
    }

    public Boolean isCurrencySymbolAtTheRight() {
        return (Boolean) get(PROPERTY_CURRENCYSYMBOLATTHERIGHT);
    }

    public void setCurrencySymbolAtTheRight(Boolean currencySymbolAtTheRight) {
        set(PROPERTY_CURRENCYSYMBOLATTHERIGHT, currencySymbolAtTheRight);
    }

    @SuppressWarnings("unchecked")
    public List<Client> getADClientList() {
      return (List<Client>) get(PROPERTY_ADCLIENTLIST);
    }

    public void setADClientList(List<Client> aDClientList) {
        set(PROPERTY_ADCLIENTLIST, aDClientList);
    }

    @SuppressWarnings("unchecked")
    public List<Role> getADRoleList() {
      return (List<Role>) get(PROPERTY_ADROLELIST);
    }

    public void setADRoleList(List<Role> aDRoleList) {
        set(PROPERTY_ADROLELIST, aDRoleList);
    }

    @SuppressWarnings("unchecked")
    public List<Country> getCountryList() {
      return (List<Country>) get(PROPERTY_COUNTRYLIST);
    }

    public void setCountryList(List<Country> countryList) {
        set(PROPERTY_COUNTRYLIST, countryList);
    }

    @SuppressWarnings("unchecked")
    public List<CurrencyTrl> getCurrencyTrlList() {
      return (List<CurrencyTrl>) get(PROPERTY_CURRENCYTRLLIST);
    }

    public void setCurrencyTrlList(List<CurrencyTrl> currencyTrlList) {
        set(PROPERTY_CURRENCYTRLLIST, currencyTrlList);
    }

    @SuppressWarnings("unchecked")
    public List<Organization> getOrganizationList() {
      return (List<Organization>) get(PROPERTY_ORGANIZATIONLIST);
    }

    public void setOrganizationList(List<Organization> organizationList) {
        set(PROPERTY_ORGANIZATIONLIST, organizationList);
    }

}
